<!doctype html>
<html lang="cn">

	<head>
		<meta charset="UTF-8">
		<title>赴美生子</title>
		<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
		<link rel="stylesheet" href="css/child.css">
		<link rel="stylesheet" href="css/upWindow.css" />
		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" href="css/style.css" />
		<link rel="stylesheet" href="css/lrscroll.css" />
		<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
		<script src="bootstrap/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="js/register.js"></script>
		<script type="text/javascript" src="js/topPublic.js"></script>
		<script src="js/banner.js"></script>
	</head>

	<body>
		<script type="text/javascript" src="js/header.js"></script>
		<div style="background-color: #f7f7f7;">
			<div class="container-fluid">
				<div class="row-fluid">
					<div class="span12">
						<img src="img/2016-06-07_132530.jpg" style="width: 100%;margin-bottom: 30px;min-width:1178px;" />
					</div>
				</div>

				<div class="row-fluid">
					<div class="head-main">
						<div class="row-fluid">
							<div class="fl" style="width: 285px;">
								<div class="accordion" id="accordion-190303">
									<div class="accordion-group">
										<div class="accordion-heading">
											<div class="accordion-toggle child-1" style=" padding-bottom: 20px;padding-top: 20px;margin-bottom: 10px;" data-toggle="collapse" data-parent="#accordion-190303" href="#accordion-element-71038">赴美生子 <span style="font-size: 14px;">/ Pre Service</span></div>
										</div>
										<div id="accordion-element-71038" class="accordion-body in collapse">
											<div class="accordion-inner child-package child-flow" mid='1' onclick="window.location.href='child.html'">套餐<span class="child-package-r">></span>
											</div>
											<div class="accordion-inner child-package" mid='2' onclick="window.location.href='childFlow.html'">流程<span class="child-package-r">></span>
											</div>
											<div class="accordion-inner child-package" mid='3' onclick="window.location.href='childInfo.html'">资讯<span class="child-package-r">></span>
											</div>
										</div>
									</div>

									<div class="accordion-group">
										<div class="accordion-heading">
											<div class="accordion-toggle collapsed child-2" style=" padding-bottom: 20px;padding-top: 20px;margin-bottom: 10px;" data-toggle="collapse" data-parent="#accordion-190303" onclick="window.open('http://tb.53kf.com/code/client/10130038/1][img]http://tb.53kf.com/kfimg.php?arg=10130038&style=1[/img]','_blank','height=500,width=750,top=220,left=500')">在线咨询</div>
										</div>
									</div>

									<div class="accordion-group">
										<div class="accordion-heading">
											<div class="accordion-toggle collapsed child-3" style=" padding-bottom: 20px;padding-top: 20px;margin-bottom: 10px;" data-toggle="collapse" data-parent="#accordion-190303" onclick="window.location.href='child.html'">套餐参考</div>
										</div>

									</div>
								</div>

								<div>
									<div class="child-contact">联系我们 <span style="font-size: 14px;color: #ccc;">/Contact Us</span></div>
									<p class="top-line"></p>
									<div><img src="img/2016-06-07_140314.png" style="width:285px;height:120px;margin-bottom:20px;"></div>
									<div class="child-name">南京圣嘉尔</div>
									<div class="child-add">地址：南京市秦淮区汉中路</div>
									<div class="child-add">89号金鹰国际商城24层C3</div>
									<div class="child-add">电话：400-163-0766</div>
									<div class="child-add">手机：18625170088</div>
									<div class="child-add">QQ：2199207469</div>
								</div>
							</div>

							<div class="fl mids mainwidth" id="mid1">
								<div class="tabbable fl bo" id="tabs-396305">
									<ul class="nav nav-tabs" id="nav_tabs">
										<!-- <li class="active">
											<a href="#panel-569755" data-toggle="tab" class="child-zone" onclick="childmit('华人专区')">华人专区</a>
											<li>
												<a href="#panel-664118" data-toggle="tab" class="child-zone" onclick="childmit('白人专区')">白人专区</a>
											</li>
											<li>
												<a href="#panel-57427" data-toggle="tab" class="child-zone" onclick="childmit('多人专区')">多人专区</a>
											</li>
											<li>
												<a href="#panel-57428" data-toggle="tab" class="child-zone" onclick="childmit('VIP专区')">VIP专区</a>
											</li> -->
									</ul>
								</div>
								<div id="cent" class="expbox">
									<div id="slide">
									</div>
									<div class="tabbox"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<input type="hidden" value="child" id="navid" />
		<script type="text/javascript" src="js/footer.js"></script>

		<script type="text/javascript">
			$(function() {
				queryChild();
			});
			var id='';
			function queryChild() {
				$.ajax({
					url: "/baby/imgInfos/getAllInformation",
					data: {
						type: "1",
						//	title: tubes
					},
					type: 'post',
					cache: false,
					dataType: 'json',
					success: function(data) {
						console.log(data);
						if(data.code == 2000) {
							//循环加载title
							var dataObj = data.data;
							var titledata = '';
	
							id=dataObj[0].sid;
							for(var i = 0; i < dataObj.length; i++) {
								if(i == 0){
									titledata = '<li class="active"><a href="#panel-664118" onclick="getInfo(\'' + dataObj[i].sid + '\')" data-toggle="tab" class="child-zone" >' + dataObj[i].title + '</a></li>'
								}else{
									titledata += '<li><a href="#panel-664118" onclick="getInfo(\'' + dataObj[i].sid + '\')" data-toggle="tab" class="child-zone" >' + dataObj[i].title + '</a></li>'
								}
							}
							$("#nav_tabs").html(titledata);
						
						} else if(data.code == 5000) {
						}
					},
					complete: function() {
						getInfo(id)
					}
				});

			}
			/*********************加载数据****************************/
			function getInfo(sid) {
				$.ajax({
					url: "/baby/imgInfos/getImgInformation",
					data: {
						sid: sid
					},
					type: 'post',
					cache: false,
					dataType: 'json',
					success: function(data) {
						console.log(data);
						if(data.code == 2000){
							var dataObj = data.data
							var imgs = dataObj.imgData;
							var img_div = '';
							var img_li = '';
							var img_a='';
							var expbox_cent = '';
							if(imgs != null) {
								for(var c = 0; c < imgs.length; c++) {
									img_li +='<li><img src="'+imgs[c].realPicUrl+'@!860" alt="" /></li>'
									if(c==0){
										img_a='<a class="active" href="javascript:void(0);"></a>  ';
									}else{
										img_a+='<a href="javascript:void(0);"></a>'
									}
								}
							}
	
							expbox_cent ='<div id="slide" class="slide">'
										+'	<a id="btnLeft" class="btnLeft" href="javascript:void(0);"></a>        '
										+'	<a id="btnRight" class="btnRight" href="javascript:void(0);"></a>       '
										+'	<ul>'+img_li+'	</ul>  '
										+'	<div id="ico" class="ico"> '
										+img_a
										+'	</div> '
										+'</div>'
										+'<div class="tabbox">'+dataObj.details+'</div>';
							$("#cent").html(expbox_cent);
						}
										
					},
					complete: function() {
						var oIco = document.getElementById("ico");
						var aBtn = oIco.getElementsByTagName("a");
						var oSlide = document.getElementById("slide");
						var oUl = oSlide.getElementsByTagName("ul");
						//var oUl = oSlide.getElementById("imgul");
						
						var aLi = oUl[0].getElementsByTagName("li");
						var oBtnLeft = document.getElementById("btnLeft");
						var oBtnRight = document.getElementById("btnRight");

						var baseWidth = aLi[0].offsetWidth;
						//alert(baseWidth);
						oUl[0].style.width = baseWidth * aLi.length + "px";
						var iNow = 0;
						for(var i = 0; i < aBtn.length; i++) {
							aBtn[i].index = i;
							aBtn[i].onclick = function() {
								//alert(this.index);
								//alert(oUl[0].style.left);
								move(this.index);
								//aIco[this.index].className = "active";
							}
						}
						oBtnLeft.onclick = function() {
							iNow++;
							//document.title = iNow;
							move(iNow);
						}
						oBtnRight.onclick = function() {
							iNow--;
							document.title = iNow;
							move(iNow);
						}

						var curIndex = 0;
						var timeInterval = 2000;
						setInterval(change, timeInterval);

						function change() {
							if(curIndex == aBtn.length) {
								curIndex = 0;
							} else {
								move(curIndex);
								curIndex += 1;
							}
						}

						function move(index) {
							//document.title = index;
							if(index > aLi.length - 1) {
								index = 0;
								iNow = index;
							}
							if(index < 0) {
								index = aLi.length - 1;
								iNow = index;
							}
							for(var n = 0; n < aBtn.length; n++) {
								aBtn[n].className = "";
							}
							aBtn[index].className = "active";
							oUl[0].style.left = -index * baseWidth + "px";
						}
					}
				});
			}
		</script>
	</body>
</html>